<template>
  <el-breadcrumb>
    <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
    <el-breadcrumb-item v-if="route !== '/home'">
      {{ getRouterStore.tit }}
    </el-breadcrumb-item>
  </el-breadcrumb>
</template>

<script setup lang="ts">
/* 获取面包屑信息 */
import router from '@/router'
import { userRouterStore } from '@/store/route/route'
import { ref, watch } from 'vue'
const getRouterStore = userRouterStore()
/* 检测当前路由 */
const route = ref()
route.value = router.currentRoute.value.fullPath
watch(
  () => router.currentRoute.value.fullPath,
  () => {
    route.value = router.currentRoute.value.fullPath
  },
)
</script>

<style lang="scss" scoped>
.el-breadcrumb {
  margin-left: 10px;
}
</style>
